package cn.iocoder.yudao.module.trade.aftersale.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.List;

@Schema(description = "用户 App - 售后订单退回货物 Request VO")
@Data
public class AppAfterSaleDeliveryReqVO {

    @Schema(description = "售后编号", example = "1024")
    private Long id;

    @Schema(description = "订单编号", example = "1024")
    private Long orderId;

    @SuppressWarnings("unused")
    @AssertTrue(message = "售后编号和订单编号不能同时为空")
    public boolean validateAfterSaleIdAndOrderId() {
        return (id != null && id > 0) || (orderId != null && orderId > 0);
    }

    @Schema(description = "退货快递公司编号，通过快递公司列表接口获取", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "退货快递公司编号不能为空")
    private Long logisticsId;

    @Schema(description = "退货物流单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SF123456789")
    @NotNull(message = "退货物流单号不能为空")
    private String logisticsNo;

    @Schema(description = "补充描述", example = "已发中通快递")
    @Length(max = 255, message = "申请原因长度不能超过 255")
    private String logisticsDescription;

    @Schema(description = "补充凭证图片")
    @Size(max = 9, message = "图片地址数组长度不能超过 9 张")
    private List<String> logisticsPicUrls;

}
